import request from "@/utils/request";
/**
 *
 * 《 定期排查--我制定的 》 页面接口文件
 *
 */

// 查询定期排查--我制定的 列表
export function listRegular(query) {
  return request({
    url: "/system/regular/list",
    method: "get",
    params: query,
  });
}

// 查询定期排查--我制定的 详细
export function getRegular(id) {
  return request({
    url: `/system/regular/${id}`,
    method: "get",
  });
}

// 新增定期排查--我制定的
export function addRegular(data) {
  return request({
    url: "/system/regular",
    method: "post",
    data: data,
  });
}

// 修改定期排查--我制定的
export function updateRegular(data) {
  return request({
    url: "/system/regular",
    method: "put",
    data: data,
  });
}

// 删除定期排查--我制定的
export function delRegular(id) {
  return request({
    url: "/system/regular/" + id,
    method: "delete",
  });
}

// 详情定期排查--我制定的
export function detailRegular(query) {
  return request({
    url: "/system/regular/getInfo",
    method: "get",
    params: query,
  });
}

//手工选择查询
export function searchStand(query) {
  return request({
    url: "/system/standard/list",
    method: "get",
    params: query,
  });
}

//填写完成发起按钮---
export function sendRegular(data) {
  return request({
    url: "/system/regular/examineAndApprove",
    method: "post",
    data,
  });
}
//填写完成提交按钮---
export function submitRegular(data) {
  return request({
    url: "/system/regular/submitRegistration",
    method: "post",
    data,
  });
}

//获取上次检查标准
export function listFrontRegular(data) {
  return request({
    url: "/system/regular/lastInspectionStandard",
    method: "post",
    data,
  });
}

//保存检查标准
export function saveRegular(data) {
  return request({
    url: "/system/regular/save",
    method: "put",
    data,
  });
}

//保存检查标准
export function registerRegular(data) {
  return request({
    url: "/system/regular/register",
    method: "post",
    data,
  });
}
//检查记录表查看（详情）
export function detailViewRegister(query) {
  return request({
    url: `/system/register/list`,
    method: "get",
    params: query
  });
}

//检查记录（详情）
export function detailRegister(id) {
  return request({
    url: `/system/register/${id}`,
    method: "get",
  });
}
//检查记录（修改）
export function editRegister(data) {
  return request({
    url: `/system/register`,
    method: "put",
    data,
  });
}
//检查记录（删除）
export function deleteRegister(ids) {
  return request({
    url: `/system/register/${ids}`,
    method: "delete",
  });
}


//隐患等级详情
export function detailRegularList(query) {
  return request({
    url: `/system/regular/list`,
    method: "get",
    params: query,
  });
}
//删除定期排查
export function deleteRegular(id) {
  return request({
    url: `/system/regular/${id}`,
    method: "delete",
  });
}

export function detailAllRegular(query) {
  return request({
    url: "/system/regular/getSummary",
    method: "get",
    params: query,
  });
}
